﻿using System.Collections.Generic;
using System;
using System.Linq;
namespace WeiTap.Validator.Result
{
    public class ValidationResult
    {
        private readonly List<ValidationFailure> errors = new List<ValidationFailure>();
        public IList<ValidationFailure> Errors => errors;
        public virtual bool IsValid => Errors.Count == 0;
        public ValidationResult(IEnumerable<ValidationFailure> failures)
        {
            errors.AddRange(failures.Where(failure => failure != null));
        }
        public ValidationResult() { }
    }
}